/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.me.hello;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.net.URL;

/**
 *
 * @author Christian
 */

public class Isla {
    
    private static String RUTA_IMAGEN = "images/isla";
    
    
    private int posX;
    private int posY;
    private int id;
    private java.awt.Image imagen;
    
    public int getPosX()
    {
        return this.posX;
    }
    
    public int getPosY()
    {
        return this.posY;
    }
    
    public int getId()
    {
        return this.id;
    }
    
    public void setPosX(int posX)
    {
        this.posX= posX;
    }
    
    public void setPosY(int posY)
    {
        this.posY= posY;
    }
    
    public void setId(int id)
    {
        this.id= id;
    }
    
        
    public Isla()
    {}
    
    public Isla(int id, int posX, int posY)
    {
        this.id= id;
        this.posX= posX;
        this.posY= posY;
        URL urlImagen = getClass().getClassLoader().getResource(RUTA_IMAGEN+id+".png");
        imagen = java.awt.Toolkit.getDefaultToolkit().getDefaultToolkit().createImage(urlImagen);
        
    }
    
    
    
    public void display(Graphics g)
    {    
        g.drawImage(this.imagen, (this.posX), (this.posY), null);
    }
}
